<script setup lang="ts">
import { usePostStore } from '@/store/post';

const store = usePostStore();

import Log from './Log.vue'
import Result from './Result.vue'

const active = ref('log')
</script>

<template>
  <el-card shadow="never" body-style="padding: 0 12px; height: 100%; position: relative;">
    <el-space class="toolbar">
      <el-button link @click="store.queryResult()"><i-ic-baseline-manage-search /></el-button>
      <el-button link disabled><i-ic-baseline-gesture /></el-button>
      <el-button link disabled><i-ep-setting /></el-button>
    </el-space>
    <el-tabs v-model="active" style="height: 100%;">
      <el-tab-pane label="日志消息" name="log" style="height: 100%;">
        <el-scrollbar height="100%">
          <Log />
        </el-scrollbar>
      </el-tab-pane>
      <el-tab-pane label="查询结果" name="result">
        <Result />
      </el-tab-pane>
    </el-tabs>
  </el-card>
</template>

<style scoped lang="scss">
.toolbar {
  position: absolute;
  top: 0;
  right: 12px;
  height: 40px;
  z-index: 999;
}
:deep(.el-tabs__nav-scroll) {
  padding-left: 16px;
}

:deep(.el-tabs__content) {
  height: calc(100% - 60px);
}
</style>